<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	


<ui:composition template="/template/templategiris.xhtml">

	<ui:define name="baslik">Marmara Üniversitesi Kütüphane Kulübü</ui:define>

	<ui:define name="ekran">
 
		<p:panel header="Kitap Arama Ekranı">

			<h:form id="tur"  >
			
				<h:panelGrid columns="3" id="turekle">
					  
					<b>Kitap tur Adı:</b>
					
                          	<p:inputText value="#{kitapTuruBean.turBilgileri.turAd}" required="true" requiredMessage="Kitap Tur Adı Boş Geçilemez!"  id="kind"/>  
                            <p:message for="kind"/> 
                    					   				     
				</h:panelGrid>
					
				<br/>
				<br/>									   				   
					<p:commandButton value="Kaydet" actionListener="#{kitapTuruBean.kaydet}"
					 style="width:80px;text-align:center" update="turekle,liste"/>					 						
				    
					<span style="padding-left: 10px"></span>
					
					<p:commandButton value="Düzenle"
					actionListener="#{kitapTuruBean.duzenle}" update="turekle,liste" style="width:80px;text-align:center" />
				<br/>
				<br/>
         </h:form> 
		
		<h:form id="liste">				
				<p:dataTable id="turlistesi" var="kitaptur" rendered="#{not empty kitapTuruBean.kitapTurListesi}" value="#{kitapTuruBean.kitapTurListesi}" 
                paginator="true" selectionMode="single" style="border:1px #66aaff;text-align:center;" rows="10" height="180"  scrollable="true" liveScroll="true" width="1000" >
							
					<f:facet name="header">Kitap Türleri</f:facet>

					<p:column style="width:200px">
						<f:facet name="header">
                          Kitap Türleri
                       </f:facet>
						<h:outputText value="#{kitaptur.turAd}" />
					</p:column>
					
					<p:column style="width:200px">
						
						<f:facet name="header"> İşlemler</f:facet>

						<h:commandLink value="Düzenle">
							<f:setPropertyActionListener value="#{kitaptur}"
								target="#{kitapTuruBean.turBilgileri}" />
						</h:commandLink>

						<span style="padding-left: 20px"></span>

						<h:commandLink value="Sil" action="#{kitapTuruBean.sil}">
							<f:setPropertyActionListener value="#{kitaptur}"
								target="#{kitapTuruBean.turBilgileri}"/>							
						</h:commandLink>

					</p:column>
							
				
				</p:dataTable>
				
				<c:if  test="#{empty kitapTuruBean.kitapTurListesi}">
                 
                   <div><h3> Aradığınız Kriterlere Uygun Kayıt Bulunamadı.</h3></div>
                      
                </c:if>
                 
                 
				<br />
				<br />
			</h:form>

		</p:panel>


	</ui:define>

</ui:composition>

</html>
